

use "$data/survey2_clean.dta", clear


loc experiments "z_impact_1 z_impact_2 z_worry_corona_econ z_worry_perecon"
			  
			  
			foreach var of varlist lnday5 lnday10 lnday20{
			egen z_`var' = std(`var')
			}
			  
preserve 

clear all
eststo clear
estimates drop _all

set obs 10
qui gen x = 1
qui gen y = 1

loc columns = 0

foreach choice in `experiments' {

    loc ++columns
    qui eststo col`columns': reg x y

}

restore


/* Statistics */

loc colnum = 1
loc colnames ""

global output_coeff ""
global output_se ""
global output_name""

foreach choice in `experiments' {

/* Statistics */

	
 xi:  reg `choice' z_lnday5 , vce(r)


	global `choice'_coeff5 =_b[z_lnday5]
	global `choice'_se5 =_se[z_lnday5]
	global output_name "$output_name `choice'_lnday5 "
	global output_coeff "$output_coeff $`choice'_coeff5 "
	global output_se "$output_se $`choice'_se5 "
 
	
 xi:  reg `choice' z_lnday10 , vce(r)

	global `choice'_coeff10 =_b[z_lnday10]
	global `choice'_se10 =_se[z_lnday10]
	global output_name "$output_name `choice'_lnday10 "
	global output_coeff "$output_coeff $`choice'_coeff10 "
	global output_se "$output_se $`choice'_se10 "		

	
		
xi:  reg `choice' z_lnday20 , vce(r)

	global `choice'_coeff20 =_b[z_lnday20]
	global `choice'_se20 =_se[z_lnday20]
	global output_name "$output_name `choice'_lnday20 "
	global output_coeff "$output_coeff $`choice'_coeff20 "
	global output_se "$output_se $`choice'_se20 "		

	} 
	

   
   
clear 

di $output_coeff

set obs 12
gen name_var = " "
gen coeff =" "
local l =1
foreach x in $output_name {
replace name_var = "`x'" in `l'
local ++l
}

local l =1
foreach x in $output_coeff {
replace coeff = "`x'" in `l'
local ++l
}

gen se =""
local l =1
foreach x in $output_se {
replace se = "`x'" in `l'
local ++l
}
destring se coeff, replace

gen uci = coeff+1.96*se
gen lci =coeff-1.96*se



export delimited using "$tables/tables_raw/exponentialgrowth.csv", replace





